
namespace fishnet
{
  template <typename CS>
  inline udp_handler<CS>::udp_writer(char* buffer)
    : _header(reinterpret_cast<udp_header*>(buffer))
  {}

  template <typename CS>
  inline void udp_handler<CS>::update_checksum()
  {
    _header->_checksum = 0;
    _header->_checksum = _checksummer(reinterpret_cast<char const*>(_header));
  }

  template <typename CS>
  inline void udp_handler<CS>::validate_checksum() const
  {
    return 0 == _checksummer(reinterpret_cast<char const*>(_header));
  }
}

